/**
*@description 用户画像》社交传播影响
*@author yhw
*/
import React, { Component, PropTypes } from 'react';
import { routerRedux } from 'dva/router';
import { connect } from 'dva';
import MainLayout from '../components/MainLayout/MainLayout';
import BarSimple from '../components/Persons/BarSimple';
import Bar2 from '../components/Persons/Bar2';
import TableList from '../components/TableList';
import {Card, Icon, Tooltip, Row, Col} from 'antd';

const tips1 = (<div>传播意愿&nbsp;
  <Tooltip placement="right" title="传播意愿是指用户传播品牌线上活动的意愿程度">
          <Icon type="question-circle-o" />
  </Tooltip></div>),
tips2 = (<div>微信传播影响力&nbsp;
  <Tooltip placement="right" title="微信传播影响力是指在微信传播活动中，衡量用户对内容/活动扩散重要性的指标">
          <Icon type="question-circle-o" />
  </Tooltip></div>)/*,
tips3 = (<div>传播内容倾向&nbsp;
  <Tooltip placement="right" title="传播内容倾向是指根据用户传播品牌线上活动信息计算得到的传播内容倾向偏好程度">
          <Icon type="question-circle-o" />
  </Tooltip></div>)*/;

class SocialInfluence extends Component {
  constructor(props) {
      super(props);
  }
  // 获取数据
  fetchData(type, search){
    this.props.dispatch({
            type: type,
            payload: search
    })
  };
  initData(){
    this.fetchData('SocialInfluence/spreadQuery','');
    this.fetchData('SocialInfluence/spreadWeixinQuery','');
    //this.fetchData('SocialInfluence/spreadContentQuery','');
  };
  componentWillMount() {
    this.initData();
  };
  render(){
  return (
    <MainLayout>
        <Row gutter={16} style={{marginTop:"29px"}}>
              <Col className="gutter-row" span={16}>
              <div className="gutter-box">
                        <Card title={tips1}>
                              <BarSimple seriesName="传播意愿" data={this.props.SocialInfluence.spreadData} loading={this.props.SocialInfluence.spreadLoading} width={"100%"} height={300} />
                        </Card>
                        <Card title={tips2}>
                              <BarSimple seriesName="微信传播影响力" data={this.props.SocialInfluence.spreadWeixinData} loading={this.props.SocialInfluence.spreadWeixinLoading} width={"100%"} height={300} />
                        </Card>
              </div>
              </Col>
              <Col className="gutter-row" span={8}><div className="gutter-box"><TableList pageSize={18} /></div></Col>
        </Row>
    </MainLayout>
  );
  }
};

/*<Card title={tips3}>
                              <Bar2 seriesName="传播内容倾向" data={this.props.SocialInfluence.spreadContentData} loading={this.props.SocialInfluence.spreadContentLoading} width={"100%"} height={300} />
                        </Card>*/

SocialInfluence.propTypes = {
};

function mapStateToProps({ SocialInfluence }) {
  return {
    SocialInfluence: {...SocialInfluence},
  };
}

export default connect(mapStateToProps)(SocialInfluence);